package cn.dkk.structure_design.combination.pojo;

/**
 * @author dkk
 * @date 2022/7/18
 * @desc 组合模式抽象根节点
 */
public abstract class MenuComponent {

    private String name;

    private int level;


    public void addChild(MenuComponent menuComponent){
        throw new UnsupportedOperationException("不支持添加操作");
    }

    public MenuComponent getChild(int index){
        throw new UnsupportedOperationException("不支持添加操作");
    }

    public void remove(int index){
        throw new UnsupportedOperationException("不支持添加操作");
    }

    public abstract void print();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
